
package com.xuelangyun.form.config;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize;

/**
 * mybatis-plus配置
 *
 * @author weiqing.hk
 * @since 2.0.0 2018-02-05
 */
@Configuration
@MapperScan(basePackages= {"com.xuelangyun.form.*.dao","com.xuelangyun.form.*.*.dao"})
public class MybatisPaginationPlusConfig {
 
	 /**
     * 分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
    	DyformPaginationInterceptor p = new DyformPaginationInterceptor();
    	p.setOverflow(true);
    	p.setCountSqlParser(new JsqlParserCountOptimize(true));
    	return p ;
    }

}
